package com.example.xyxwebbackend001.model.DTO;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

// 主请求体
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ArticleRequestDTO {

    private String articleToken;

    @Valid
    private List<ContentBlockDTO> content;

    @Valid
    private ArticleCover cover;

    @NotBlank
    private String description;

    @Pattern(regexp = "^\\d{3,4}$", message = "地区编码必须是3-4位数字")
    private String place;

    @Size(max = 50)
    private String title;

    private String tags;
}